Skip to content

Add type hints to mocket.plugins.httpretty #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 6, 2025

Conversation

JPDSousa
Copy link
Contributor

@JPDSousa JPDSousa commented May 6, 2025

See #203

While the type hints introduced are not that extensive, they do pass some basic mypy rules (e.g., disallow_untyped_decorators).

I used tests.test_httpretty to test the type hints introduced. Again, while it's not an exhaustive approach, it provides some sanity check that types work as expected.

@JPDSousa
Copy link
Contributor Author

JPDSousa commented May 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Remove this unexpected named argument 'kwsyntax'.

@mindflayer is this because I removed unused-ignore?

@mindflayer
Copy link
Owner

mindflayer commented May 6, 2025

is this because I removed unused-ignore?

I think those are two different things:

Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.70%. Comparing base (2ad3bec) to head (8b2eeda).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
+ Coverage   98.59%   98.70%   +0.11%     
==========================================
  Files          22       22              
  Lines         994     1004      +10     
==========================================
+ Hits          980      991      +11     
+ Misses         14       13       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JPDSousa
Copy link
Contributor Author

JPDSousa commented May 6, 2025

@mindflayer here's the status of both failing checks:

  1. codecov is failing due to the added type ignore in get_mocketize
  2. Mocket's CI fails because httpbin.org is really unavailable.

What do you suggest?

@mindflayer
Copy link
Owner

mindflayer commented May 6, 2025

Mocket's CI fails because httpbin.org is really unavailable.

For when this happens, the only possible solution is waiting and retry, which is what I've just done (it's now flagged as succeeded).

I tried a bunch of similar services, and of course they do not work 100% of the times (which is the actual reason for Mocket to exist in the first place: to make CIs great again :) ).

@JPDSousa
Copy link
Contributor Author

JPDSousa commented May 6, 2025

Added unit tests to get mocketize to make the coverage happy

Copy link

sonarqubecloud bot commented May 6, 2025

@JPDSousa
Copy link
Contributor Author

JPDSousa commented May 6, 2025

@mindflayer This should be ready to review. The CI is failing again due to httpbin

@mindflayer
Copy link
Owner

mindflayer commented May 6, 2025 via email

@mindflayer mindflayer merged commit a27d9d9 into mindflayer:main May 6, 2025
11 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants